/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package golftourcalculator;

/**
 *
 * @author Martin
 */
public class TournamentResult {
    
    private int rank;
    private String playerName;
    private String clubAbbreviation;
    private String cardId;
    private int bruttoResult;
    private int nettoResult;
    private int result;
    
    TournamentResult(int rank, String playerName, String clubAbbreviation, String cardId,
        int bruttoResult, int nettoResult) {
        this.rank = rank;
        this.playerName = playerName;
        this.clubAbbreviation = clubAbbreviation;
        this.cardId = cardId;
        this.bruttoResult = bruttoResult;
        this.nettoResult = nettoResult;
        this.updateResult();
    }

    /**
     * @return the playerName
     */
    public String getPlayerName() {
        return playerName;
    }

    /**
     * @param playerName the playerName to set
     */
    public void setPlayerName(String playerName) {
        this.playerName = playerName;
    }

    /**
     * @return the clubAbbreviation
     */
    public String getClubAbbreviation() {
        return clubAbbreviation;
    }

    /**
     * @param clubAbbreviation the clubAbbreviation to set
     */
    public void setClubAbbreviation(String clubAbbreviation) {
        this.clubAbbreviation = clubAbbreviation;
    }

    /**
     * @return the cardId
     */
    public String getCardId() {
        return cardId;
    }

    /**
     * @param cardId the cardId to set
     */
    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    /**
     * @return the bruttoResult
     */
    public int getBruttoResult() {
        return bruttoResult;
    }

    /**
     * @param bruttoResult the bruttoResult to set
     */
    public void setBruttoResult(int bruttoResult) {
        this.bruttoResult = bruttoResult;
        this.updateResult();
    }

    /**
     * @return the nettoResult
     */
    public int getNettoResult() {
        return nettoResult;
    }

    /**
     * @param nettoResult the nettoResult to set
     */
    public void setNettoResult(int nettoResult) {
        this.nettoResult = nettoResult;
        this.updateResult();
    }

    /**
     * @return the result
     */
    public int getResult() {
        return result;
    }

    /**
     * @return the rank
     */
    public int getRank() {
        return rank;
    }

    /**
     * @param rank the rank to set
     */
    public void setRank(int rank) {
        this.rank = rank;
    }

    private void updateResult() {
        // TODO
        
        this.result = bruttoResult + (2 * nettoResult);
    }
}
